#include "mainwindow.h"
#include "ui_mainwindow.h"

#include <QDockWidget>

QDockWidget * dockWidget(QWidget *widget, QWidget *parent)
{
    QDockWidget *dock = new QDockWidget(parent);
    dock->setWidget(widget);
    return dock;
}

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

#include <QColorDialog>

void MainWindow::on_addDockWidget_clicked()
{
    QColorDialog *color = new QColorDialog(this);

    this->addDockWidget(Qt::LeftDockWidgetArea, dockWidget(color, this));
    ui->addDockWidget->setEnabled(false);
}

